<%--
  Created by IntelliJ IDEA.
  User: ZENG
  Date: 2021/8/22
  Time: 10:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>$Title$</title>
    <script type="text/javascript" src="${pageContext.request.contextPath}/statics/js/jquery-3.6.0.js"></script>
    <script>
        function a() {
            $.post({
                url: "${pageContext.request.contextPath}/a1",
                data: {"name": $("#txtName").val()},
                success: function (data,status) {
                    alert(data);
                    console.log(status)
                }
            })
            // alert(1);
        }
    </script>
</head>
<body>
<%--onblur：失去焦点触发事件--%>
用户名:<input type="text" id="txtName" onblur="a()">
</body>
</html>